package com.zhx.jpa.controller;

import com.zhx.jpa.userHolder.UserInfoImplHolder;
import com.zhx.jpa.userHolder.UserInfoInf;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.ManagedBean;

/**
 * @author zhanghaixuan
 * @create 2018/1/24-下午2:53
 **/
@RestController
@RequestMapping("/web")
public class WebUserController {


    @Autowired
    private UserInfoImplHolder userInfoImplHolder;

    @GetMapping("/get")
    public String getUser(@RequestParam String type){
        UserInfoInf userInfoInf = userInfoImplHolder.findUserInfoInf(type);
        userInfoInf.get(null);
        return "success";
    }


    @GetMapping("/set")
    public String setUser(@RequestParam String type){
        UserInfoInf userInfoInf = userInfoImplHolder.findUserInfoInf(type);
        userInfoInf.save(null);
        return "success";
    }

}
